﻿Imports System.Data
Public Class UserEnter
    Protected Shared Ds As DataSet = New DataSet
    Public Shared Function identity(ByVal ID As String, ByVal PassWord As String, ByRef Level As Long) As Boolean
        Dim Ret As Boolean = False
        Ds.Clear()
        Ds = GlobalClass.SQLclass.Sqlcmd("select * from UserInfo where 员工号='" + ID + "' and 登录密码='" + Crypt.MD5(PassWord) + "'", "User")
        If (Ds.Tables("User").Rows.Count = 1) Then
            Level = Convert.ToInt32(Ds.Tables("User").Rows(0)("职位"))
            Ret = True
        Else
            Throw New Exception("用户名或密码错误!")
        End If
        Return Ret
    End Function
End Class
